﻿using Furion.DataEncryption;
using Furion.DependencyInjection;
using Vboot.Core.Framework;
using Vboot.Core.Module.Sys;

namespace Vboot.Web.Init;

//组织架构初始化，可根据配置生成不同的基础数据
public class SysOrgInit : ITransient
{
    private readonly SqlSugarRepository<SysOrgDept> _deptRepo;
    private readonly SqlSugarRepository<SysOrg> _orgRepo;
    private readonly SqlSugarRepository<SysOrgUser> _userRepo;

    public SysOrgInit(SqlSugarRepository<SysOrgDept> deptRepo,
        SqlSugarRepository<SysOrg> orgRepo,
        SqlSugarRepository<SysOrgUser> userRepo)
    {
        _deptRepo = deptRepo;
        _orgRepo = orgRepo;
        _userRepo = userRepo;
    }


    //初始化部门
    public async Task initDept()
    {
        var deptList = new List<SysOrgDept>();
        var orgList = new List<SysOrg>();
        SysOrgDept wc = new SysOrgDept();
        wc.id = "wc";
        wc.name = "WC集团";
        wc.label = "wc";
        wc.ornum = 0;
        wc.avtag = true;
        wc.tier = "xwcx";
        wc.type = 1;
        deptList.Add(wc);
        orgList.Add(new SysOrg(wc.id,wc.name));

        SysOrgDept wca = new SysOrgDept();
        wca.id = "a";
        wca.name = "A组_卡厄塞荷";
        wca.label = "wc";
        wca.ornum = 1;
        wca.avtag = true;
        wca.tier = "xwcxax";
        wca.type = 1;
        wca.pid = "wc";
        deptList.Add(wca);
        orgList.Add(new SysOrg(wca.id,wca.name));

        SysOrgDept a1 = new SysOrgDept();
        a1.id = "a1";
        a1.name = "卡塔尔";
        a1.label = "wc";
        a1.ornum = 1;
        a1.avtag = true;
        a1.tier = "xwcxaxa1x";
        a1.type = 1;
        a1.pid = "a";
        deptList.Add(a1);
        orgList.Add(new SysOrg(a1.id,a1.name));
        AddPostionDept(deptList,orgList, "a1");
      

        SysOrgDept a2 = new SysOrgDept();
        a2.id = "a2";
        a2.name = "厄瓜多尔";
        a2.label = "wc";
        a2.ornum = 2;
        a2.avtag = true;
        a2.tier = "xwcxaxa2x";
        a2.type = 1;
        a2.pid = "a";
        deptList.Add(a2);
        orgList.Add(new SysOrg(a2.id,a2.name));
        AddPostionDept(deptList,orgList, "a2");

        SysOrgDept a3 = new SysOrgDept();
        a3.id = "a3";
        a3.name = "塞内加尔";
        a3.label = "wc";
        a3.ornum = 3;
        a3.avtag = true;
        a3.tier = "xwcxaxa3x";
        a3.type = 1;
        a3.pid = "a";
        deptList.Add(a3);
        orgList.Add(new SysOrg(a3.id,a3.name));
        AddPostionDept(deptList,orgList, "a3");

        SysOrgDept a4 = new SysOrgDept();
        a4.id = "a4";
        a4.name = "荷兰";
        a4.label = "wc";
        a4.ornum = 4;
        a4.avtag = true;
        a4.tier = "xwcxaxa4x";
        a4.type = 1;
        a4.pid = "a";
        deptList.Add(a4);
        orgList.Add(new SysOrg(a4.id,a4.name));
        AddPostionDept(deptList,orgList, "a4");

        SysOrgDept wcb = new SysOrgDept();
        wcb.id = "b";
        wcb.name = "B组_英伊美威";
        wcb.label = "wc";
        wcb.ornum = 2;
        wcb.avtag = true;
        wcb.tier = "xwcxbx";
        wcb.type = 1;
        wcb.pid = "wc";
        deptList.Add(wcb);
        orgList.Add(new SysOrg(wcb.id,wcb.name));

        SysOrgDept b1 = new SysOrgDept();
        b1.id = "b1";
        b1.name = "英格兰";
        b1.label = "wc";
        b1.ornum = 1;
        b1.avtag = true;
        b1.tier = "xwcxbxb1x";
        b1.type = 1;
        b1.pid = "b";
        deptList.Add(b1);
        orgList.Add(new SysOrg(b1.id,b1.name));
        AddPostionDept(deptList,orgList, "b1");

        SysOrgDept b2 = new SysOrgDept();
        b2.id = "b2";
        b2.name = "伊朗";
        b2.label = "wc";
        b2.ornum = 2;
        b2.avtag = true;
        b2.tier = "xwcxbxb2x";
        b2.type = 1;
        b2.pid = "b";
        deptList.Add(b2);
        orgList.Add(new SysOrg(b2.id,b2.name));
        AddPostionDept(deptList,orgList, "b2");

        SysOrgDept b3 = new SysOrgDept();
        b3.id = "b3";
        b3.name = "美国";
        b3.label = "wc";
        b3.ornum = 3;
        b3.avtag = true;
        b3.tier = "xwcxbxb3x";
        b3.type = 1;
        b3.pid = "b";
        deptList.Add(b3);
        orgList.Add(new SysOrg(b3.id,b3.name));
        AddPostionDept(deptList,orgList, "b3");

        SysOrgDept b4 = new SysOrgDept();
        b4.id = "b4";
        b4.name = "威尔士";
        b4.label = "wc";
        b4.ornum = 4;
        b4.avtag = true;
        b4.tier = "xwcxbxb4x";
        b4.type = 1;
        b4.pid = "b";
        deptList.Add(b4);
        orgList.Add(new SysOrg(b4.id,b4.name));
        AddPostionDept(deptList,orgList, "b4");

        SysOrgDept wcc = new SysOrgDept();
        wcc.id = "c";
        wcc.name = "C组_阿沙墨波";
        wcc.label = "wc";
        wcc.ornum = 3;
        wcc.avtag = true;
        wcc.tier = "xwcxcx";
        wcc.type = 1;
        wcc.pid = "wc";
        deptList.Add(wcc);
        orgList.Add(new SysOrg(wcc.id,wcc.name));

        SysOrgDept c1 = new SysOrgDept();
        c1.id = "c1";
        c1.name = "阿根廷";
        c1.label = "wc";
        c1.ornum = 1;
        c1.avtag = true;
        c1.tier = "xwcxcxc1x";
        c1.type = 1;
        c1.pid = "c";
        deptList.Add(c1);
        orgList.Add(new SysOrg(c1.id,c1.name));
        AddPostionDept(deptList,orgList, "c1");

        SysOrgDept c2 = new SysOrgDept();
        c2.id = "c2";
        c2.name = "沙特";
        c2.label = "wc";
        c2.ornum = 2;
        c2.avtag = true;
        c2.tier = "xwcxcxc2x";
        c2.type = 1;
        c2.pid = "c";
        deptList.Add(c2);
        orgList.Add(new SysOrg(c2.id,c2.name));
        AddPostionDept(deptList,orgList, "c2");

        SysOrgDept c3 = new SysOrgDept();
        c3.id = "c3";
        c3.name = "墨西哥";
        c3.label = "wc";
        c3.ornum = 3;
        c3.avtag = true;
        c3.tier = "xwcxcxc3x";
        c3.type = 1;
        c3.pid = "c";
        deptList.Add(c3);
        orgList.Add(new SysOrg(c3.id,c3.name));
        AddPostionDept(deptList,orgList, "c3");

        SysOrgDept c4 = new SysOrgDept();
        c4.id = "c4";
        c4.name = "波兰";
        c4.label = "wc";
        c4.ornum = 4;
        c4.avtag = true;
        c4.tier = "xwcxcxc4x";
        c4.type = 1;
        c4.pid = "c";
        deptList.Add(c4);
        orgList.Add(new SysOrg(c4.id,c4.name));
        AddPostionDept(deptList,orgList, "c4");

        SysOrgDept wcd = new SysOrgDept();
        wcd.id = "d";
        wcd.name = "D组_法澳丹突";
        wcd.label = "wc";
        wcd.ornum = 4;
        wcd.avtag = true;
        wcd.tier = "xwcxdx";
        wcd.type = 1;
        wcd.pid = "wc";
        deptList.Add(wcd);
        orgList.Add(new SysOrg(wcd.id,wcd.name));

        SysOrgDept d1 = new SysOrgDept();
        d1.id = "d1";
        d1.name = "法国";
        d1.label = "wc";
        d1.ornum = 1;
        d1.avtag = true;
        d1.tier = "xwcxdxd1x";
        d1.type = 1;
        d1.pid = "d";
        deptList.Add(d1);
        orgList.Add(new SysOrg(d1.id,d1.name));
        AddPostionDept(deptList,orgList, "d1");

        SysOrgDept d2 = new SysOrgDept();
        d2.id = "d2";
        d2.name = "澳大利亚";
        d2.label = "wc";
        d2.ornum = 2;
        d2.avtag = true;
        d2.tier = "xwcxdxd2x";
        d2.type = 1;
        d2.pid = "d";
        deptList.Add(d2);
        orgList.Add(new SysOrg(d2.id,d2.name));
        AddPostionDept(deptList,orgList, "d2");

        SysOrgDept d3 = new SysOrgDept();
        d3.id = "d3";
        d3.name = "丹麦";
        d3.label = "wc";
        d3.ornum = 3;
        d3.avtag = true;
        d3.tier = "xwcxdxd3x";
        d3.type = 1;
        d3.pid = "d";
        deptList.Add(d3);
        orgList.Add(new SysOrg(d3.id,d3.name));
        AddPostionDept(deptList,orgList, "d3");

        SysOrgDept d4 = new SysOrgDept();
        d4.id = "d4";
        d4.name = "突尼斯";
        d4.label = "wc";
        d4.ornum = 4;
        d4.avtag = true;
        d4.tier = "xwcxdxd4x";
        d4.type = 1;
        d4.pid = "d";
        deptList.Add(d4);
        orgList.Add(new SysOrg(d4.id,d4.name));
        AddPostionDept(deptList,orgList, "d4");

        SysOrgDept wce = new SysOrgDept();
        wce.id = "e";
        wce.name = "E组_西哥德日";
        wce.label = "wc";
        wce.ornum = 5;
        wce.avtag = true;
        wce.tier = "xwcxex";
        wce.type = 1;
        wce.pid = "wc";
        deptList.Add(wce);
        orgList.Add(new SysOrg(wce.id,wce.name));

        SysOrgDept e1 = new SysOrgDept();
        e1.id = "e1";
        e1.name = "西班牙";
        e1.label = "wc";
        e1.ornum = 1;
        e1.avtag = true;
        e1.tier = "xwcxexe1x";
        e1.type = 1;
        e1.pid = "e";
        deptList.Add(e1);
        orgList.Add(new SysOrg(e1.id,e1.name));
        AddPostionDept(deptList,orgList, "e1");

        SysOrgDept e2 = new SysOrgDept();
        e2.id = "e2";
        e2.name = "哥斯达黎加";
        e2.label = "wc";
        e2.ornum = 2;
        e2.avtag = true;
        e2.tier = "xwcxexe2x";
        e2.type = 1;
        e2.pid = "e";
        deptList.Add(e2);
        orgList.Add(new SysOrg(e2.id,e2.name));
        AddPostionDept(deptList,orgList, "e2");

        SysOrgDept e3 = new SysOrgDept();
        e3.id = "e3";
        e3.name = "德国";
        e3.label = "wc";
        e3.ornum = 3;
        e3.avtag = true;
        e3.tier = "xwcxexe3x";
        e3.type = 1;
        e3.pid = "e";
        deptList.Add(e3);
        orgList.Add(new SysOrg(e3.id,e3.name));
        AddPostionDept(deptList,orgList, "e3");

        SysOrgDept e4 = new SysOrgDept();
        e4.id = "e4";
        e4.name = "日本";
        e4.label = "wc";
        e4.ornum = 4;
        e4.avtag = true;
        e4.tier = "xwcxexe4x";
        e4.type = 1;
        e4.pid = "e";
        deptList.Add(e4);
        orgList.Add(new SysOrg(e4.id,e4.name));
        AddPostionDept(deptList,orgList, "e4");

        SysOrgDept wcf = new SysOrgDept();
        wcf.id = "f";
        wcf.name = "F组_比加摩克";
        wcf.label = "wc";
        wcf.ornum = 6;
        wcf.avtag = true;
        wcf.tier = "xwcxfx";
        wcf.type = 1;
        wcf.pid = "wc";
        deptList.Add(wcf);
        orgList.Add(new SysOrg(wcf.id,wcf.name));

        SysOrgDept f1 = new SysOrgDept();
        f1.id = "f1";
        f1.name = "比利时";
        f1.label = "wc";
        f1.ornum = 1;
        f1.avtag = true;
        f1.tier = "xwcxfxf1x";
        f1.type = 1;
        f1.pid = "f";
        deptList.Add(f1);
        orgList.Add(new SysOrg(f1.id,f1.name));
        AddPostionDept(deptList,orgList, "f1");

        SysOrgDept f2 = new SysOrgDept();
        f2.id = "f2";
        f2.name = "加拿大";
        f2.label = "wc";
        f2.ornum = 2;
        f2.avtag = true;
        f2.tier = "xwcxfxf2x";
        f2.type = 1;
        f2.pid = "f";
        deptList.Add(f2);
        orgList.Add(new SysOrg(f2.id,f2.name));
        AddPostionDept(deptList,orgList, "f2");

        SysOrgDept f3 = new SysOrgDept();
        f3.id = "f3";
        f3.name = "摩洛哥";
        f3.label = "wc";
        f3.ornum = 3;
        f3.avtag = true;
        f3.tier = "xwcxfxf3x";
        f3.type = 1;
        f3.pid = "f";
        deptList.Add(f3);
        orgList.Add(new SysOrg(f3.id,f3.name));
        AddPostionDept(deptList,orgList, "f3");

        SysOrgDept f4 = new SysOrgDept();
        f4.id = "f4";
        f4.name = "克罗地亚";
        f4.label = "wc";
        f4.ornum = 4;
        f4.avtag = true;
        f4.tier = "xwcxfxf4x";
        f4.type = 1;
        f4.pid = "f";
        deptList.Add(f4);
        orgList.Add(new SysOrg(f4.id,f4.name));
        AddPostionDept(deptList,orgList, "f4");

        SysOrgDept wcg = new SysOrgDept();
        wcg.id = "g";
        wcg.name = "G组_巴塞瑞喀";
        wcg.label = "wc";
        wcg.ornum = 7;
        wcg.avtag = true;
        wcg.tier = "xwcxgx";
        wcg.type = 1;
        wcg.pid = "wc";
        deptList.Add(wcg);
        orgList.Add(new SysOrg(wcg.id,wcg.name));

        SysOrgDept g1 = new SysOrgDept();
        g1.id = "g1";
        g1.name = "巴西";
        g1.label = "wc";
        g1.ornum = 1;
        g1.avtag = true;
        g1.tier = "xwcxgxg1x";
        g1.type = 1;
        g1.pid = "g";
        deptList.Add(g1);
        orgList.Add(new SysOrg(g1.id,g1.name));
        AddPostionDept(deptList,orgList, "g1");

        SysOrgDept g2 = new SysOrgDept();
        g2.id = "g2";
        g2.name = "塞尔维亚";
        g2.label = "wc";
        g2.ornum = 2;
        g2.avtag = true;
        g2.tier = "xwcxgxg2x";
        g2.type = 1;
        g2.pid = "g";
        deptList.Add(g2);
        orgList.Add(new SysOrg(g2.id,g2.name));
        AddPostionDept(deptList, orgList,"g2");

        SysOrgDept g3 = new SysOrgDept();
        g3.id = "g3";
        g3.name = "瑞士";
        g3.label = "wc";
        g3.ornum = 3;
        g3.avtag = true;
        g3.tier = "xwcxgxg3x";
        g3.type = 1;
        g3.pid = "g";
        deptList.Add(g3);
        orgList.Add(new SysOrg(g3.id,g3.name));
        AddPostionDept(deptList,orgList, "g3");

        SysOrgDept g4 = new SysOrgDept();
        g4.id = "g4";
        g4.name = "喀麦隆";
        g4.label = "wc";
        g4.ornum = 4;
        g4.avtag = true;
        g4.tier = "xwcxgxg4x";
        g4.type = 1;
        g4.pid = "g";
        deptList.Add(g4);
        orgList.Add(new SysOrg(g4.id,g4.name));
        AddPostionDept(deptList,orgList, "g4");

        SysOrgDept wch = new SysOrgDept();
        wch.id = "h";
        wch.name = "H组_葡加乌韩";
        wch.label = "wc";
        wch.ornum = 8;
        wch.avtag = true;
        wch.tier = "xwcxhx";
        wch.type = 1;
        wch.pid = "wc";
        deptList.Add(wch);
        orgList.Add(new SysOrg(wch.id,wch.name));

        SysOrgDept h1 = new SysOrgDept();
        h1.id = "h1";
        h1.name = "葡萄牙";
        h1.label = "wc";
        h1.ornum = 1;
        h1.avtag = true;
        h1.tier = "xwcxhxh1x";
        h1.type = 1;
        h1.pid = "h";
        deptList.Add(h1);
        orgList.Add(new SysOrg(h1.id,h1.name));
        AddPostionDept(deptList,orgList, "h1");

        SysOrgDept h2 = new SysOrgDept();
        h2.id = "h2";
        h2.name = "加纳";
        h2.label = "wc";
        h2.ornum = 2;
        h2.avtag = true;
        h2.tier = "xwcxhxh2x";
        h2.type = 1;
        h2.pid = "h";
        deptList.Add(h2);
        orgList.Add(new SysOrg(h2.id,h2.name));
        AddPostionDept(deptList,orgList, "h2");

        SysOrgDept h3 = new SysOrgDept();
        h3.id = "h3";
        h3.name = "乌拉圭";
        h3.label = "wc";
        h3.ornum = 3;
        h3.avtag = true;
        h3.tier = "xwcxhxh3x";
        h3.type = 1;
        h3.pid = "h";
        deptList.Add(h3);
        orgList.Add(new SysOrg(h3.id,h3.name));
        AddPostionDept(deptList,orgList, "h3");

        SysOrgDept h4 = new SysOrgDept();
        h4.id = "h4";
        h4.name = "韩国";
        h4.label = "wc";
        h4.ornum = 4;
        h4.avtag = true;
        h4.tier = "xwcxhxh4x";
        h4.type = 1;
        h4.pid = "h";
        deptList.Add(h4);
        orgList.Add(new SysOrg(h4.id,h4.name));
        AddPostionDept(deptList,orgList, "h4");

//        SysOrgDept ec1=new SysOrgDept();
//        ec1.setId("ec1");
//        ec1.setName("客户");
//        ec1.setLabel("ec1");
//        ec1.setOrnum(1);
//        ec1.setAvtag(true);
//        ec1.setTier("xec1x");
//        deptList.add(ec1);
//
//        SysOrgDept ec2=new SysOrgDept();
//        ec2.setId("ec2");
//        ec2.setName("渠道商");
//        ec2.setLabel("ec2");
//        ec2.setOrnum(2);
//        ec2.setAvtag(true);
//        ec2.setTier("xec2x");
//        deptList.add(ec2);
//
//        SysOrgDept ec3=new SysOrgDept();
//        ec3.setId("ec3");
//        ec3.setName("供应商");
//        ec3.setLabel("ec3");
//        ec3.setOrnum(3);
//        ec3.setAvtag(true);
//        ec3.setTier("xec3x");
//        deptList.add(ec3);

        await _deptRepo.InsertRangeAsync(deptList);
        await _orgRepo.InsertRangeAsync(orgList);
    }

    //公司及子公司初始化


    //管理员初始化，正式项目一般只初始化这个就够了，上面的都是演示数据
    public async Task InitSa()
    {
        Console.WriteLine("开始初始化数据");
        SysOrgUser user = new SysOrgUser();
        user.id = "sa";
        user.usnam = "sa";
        user.name = "管理员";
        user.pacod = MD5Encryption.Encrypt("abc1xyz");
        user.avtag = true;
        user.tier = "xsax";
        user.crtim = DateTime.Now;
        await _userRepo.InsertAsync(user);
        await _orgRepo.InsertAsync(new SysOrg("sa", "管理员"));

        SysOrgUser user2 = new SysOrgUser();
        user2.id = "vben";
        user2.usnam = "vben";
        user2.name = "管理员";
        user2.pacod = MD5Encryption.Encrypt("abc123456xyz");
        user2.avtag = true;
        user2.tier = "xvbenx";
        user2.crtim = DateTime.Now;
        await _userRepo.InsertAsync(user2);
        await _orgRepo.InsertAsync(new SysOrg("vben", "管理员"));
    }

    private void AddPostionDept(List<SysOrgDept> deptList,List<SysOrg> orgList, string id)
    {
        SysOrgDept qf=new SysOrgDept();
        qf.id=id+"qf";
        qf.name=id.Substring(0,1).ToUpper()+id.Substring(1)+"_前锋";
        qf.label="wc";
        qf.ornum=1;
        qf.avtag=true;
        qf.tier="xwcx"+id.Substring(0,1)+"x"+id+"x"+id+"qf"+"x";
        qf.type=2;
        qf.pid=id;
        deptList.Add(qf);
        orgList.Add(new SysOrg(qf.id,qf.name));
//
        SysOrgDept zc=new SysOrgDept();
        zc.id=id+"zc";
        zc.name=id.Substring(0,1).ToUpper()+id.Substring(1)+"_中场";
        zc.label="wc";
        zc.ornum=2;
        zc.avtag=true;
        zc.tier="xwcx"+id.Substring(0,1)+"x"+id+"x"+id+"zc"+"x";
        zc.type=2;
        zc.pid=id;
        deptList.Add(zc);
        orgList.Add(new SysOrg(zc.id,zc.name));
//
        SysOrgDept hw=new SysOrgDept();
        hw.id=id+"hw";
        hw.name=id.Substring(0,1).ToUpper()+id.Substring(1)+"_后卫";
        hw.label="wc";
        hw.ornum=3;
        hw.avtag=true;
        hw.tier="xwcx"+id.Substring(0,1)+"x"+id+"x"+id+"hw"+"x";
        hw.type=2;
        hw.pid=id;
        deptList.Add(hw);
        orgList.Add(new SysOrg(hw.id,hw.name));
//
        SysOrgDept mj=new SysOrgDept();
        mj.id=id+"mj";
        mj.name=id.Substring(0,1).ToUpper()+id.Substring(1)+"_门将";
        mj.label="wc";
        mj.ornum=4;
        mj.avtag=true;
        mj.tier="xwcx"+id.Substring(0,1)+"x"+id+"x"+id+"mj"+"x";
        mj.type=2;
        mj.pid=id;
        deptList.Add(mj);
        orgList.Add(new SysOrg(mj.id,mj.name));
    }
    
    
    public async Task initTopUser() {
        var userList=new List<SysOrgUser>();
        var orgList=new List<SysOrg>();
        
        SysOrgUser u1 = new SysOrgUser();
        u1.id="l1";
        u1.usnam="l1";
        u1.name="刘一";
        u1.pacod=MD5Encryption.Encrypt("abc1xyz");;
        u1.ornum=1;
        u1.avtag=true;
        u1.deptid="a";
        u1.tier="xwcxaxl1x";
        userList.Add(u1);
        orgList.Add(new SysOrg(u1.id,u1.name));

        SysOrgUser u2 = new SysOrgUser();
        u2.id="k2";
        u2.usnam="c2";
        u2.name="陈二";
        u2.pacod=MD5Encryption.Encrypt("abc1xyz");;
        u2.ornum=2;
        u2.avtag=true;
        u2.deptid="b";
        u2.tier="xwcxbxk2x";
        userList.Add(u2);
        orgList.Add(new SysOrg(u2.id,u2.name));

        SysOrgUser u3 = new SysOrgUser();
        u3.id="z3";
        u3.usnam="z3";
        u3.name="张三";
        u3.pacod=MD5Encryption.Encrypt("abc1xyz");;
        u3.ornum=3;
        u3.avtag=true;
        u3.deptid="c";
        u3.tier="xwcxcxz3x";
        userList.Add(u3);
        orgList.Add(new SysOrg(u3.id,u3.name));

        SysOrgUser u4 = new SysOrgUser();
        u4.id="l4";
        u4.usnam="l4";
        u4.name="李四";
        u4.pacod=MD5Encryption.Encrypt("abc1xyz");;
        u4.ornum=4;
        u4.avtag=true;
        u4.deptid="d";
        u4.tier="xwcxdxl4x";
        userList.Add(u4);
        orgList.Add(new SysOrg(u4.id,u4.name));

        SysOrgUser u5 = new SysOrgUser();
        u5.id="w5";
        u5.usnam="w5";
        u5.name="王五";
        u5.pacod=MD5Encryption.Encrypt("abc1xyz");;
        u5.ornum=5;
        u5.avtag=true;
        u5.deptid="e";
        u5.tier="xwcxexw5x";
        userList.Add(u5);
        orgList.Add(new SysOrg(u5.id,u5.name));

        SysOrgUser u6 = new SysOrgUser();
        u6.id="z6";
        u6.usnam="z6";
        u6.name="赵六";
        u6.pacod=MD5Encryption.Encrypt("abc1xyz");;
        u6.ornum=6;
        u6.avtag=true;
        u6.deptid="f";
        u6.tier="xwcxfxz6x";
        userList.Add(u6);
        orgList.Add(new SysOrg(u6.id,u6.name));

        SysOrgUser u7 = new SysOrgUser();
        u7.id="s7";
        u7.usnam="s7";
        u7.name="孙七";
        u7.pacod=MD5Encryption.Encrypt("abc1xyz");
        u7.ornum=7;
        u7.avtag=true;
        u7.deptid="g";
        u7.tier="xwcxgxs7x";
        userList.Add(u7);
        orgList.Add(new SysOrg(u7.id,u7.name));

        SysOrgUser u8 = new SysOrgUser();
        u8.id="z8";
        u8.usnam="z8";
        u8.name="周八";
        u8.pacod=MD5Encryption.Encrypt("abc1xyz");;
        u8.ornum=8;
        u8.avtag=true;
        u8.deptid="h";
        u8.tier="xwcxhxz8x";
        userList.Add(u8);
        orgList.Add(new SysOrg(u8.id,u8.name));

        await _userRepo.InsertRangeAsync(userList);
        await _orgRepo.InsertRangeAsync(orgList);
    }
}